package com.ssd.controller.inner;

import com.ssd.api.order.OrderApi;
import com.ssd.api.order.dto.OrderDetailViewModel;
import com.ssd.service.OrderService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("/inner/order")
@RestController
@Api(tags = "内部接口 - 商品相关接口")
public class OrderApiController implements OrderApi {
    @Resource
    private OrderService orderService;

    @GetMapping("/getOrderNo")
    public String getOrderNo(String transactionId) {
        return orderService.getByTransactionId(transactionId);
    }

    @GetMapping("/getOrderList")
    public List<OrderDetailViewModel> getOrderList(String orderNo) {
        return orderService.getListByOrderNo(orderNo);
    }
}
